<?php

namespace App\Admin\Renders;

use App\Models\Player;
use Dcat\Admin\Support\LazyRenderable;

class PlayerGuideRender extends LazyRenderable
{
    public function render(): string
    {
        $player = Player::where('slug', $this->payload['player_id'])->first();
        $poster = $player->posters()->latest()->first();
        $image = $poster->cover_url;

        return <<<HTML
            <img style="width: 100%" src="$image" alt=""/>
            HTML;
    }
}
